.my-animation {
  width: 200px;
  height: 200px;
  background-color: yellowgreen;
  animation-name: changecolor;
  animation-duration: 3s;
  animation-iteration-count: 3;
  animation-direction: reverse;
  animation-timing-function: ease-in;
}
@keyframes changecolor {
  from {
    background-color: blue;
  }
  to {
    background-color: red;
  }
}